<!DOCTYPE html>

<html>
<head>
    <title>@(ViewBag.Title + ViewBag.Settings["BlogName"])</title>
    @if (!string.IsNullOrEmpty(ViewBag.Settings["Favicon"]))
    {
        <link rel="shortcut icon" type="image/x-icon" href="@ViewBag.Settings["Favicon"]" />
    }
    <meta name="viewport" content="width=device-width" />
    <link href="~/css/reset.css" rel="stylesheet" />

    <environment include="Development">
        <link href="~/lib/twitter-bootstrap/css/bootstrap.css" rel="stylesheet" />
        <script src="~/lib/jquery/jquery.js"></script>
        <script src="~/lib/twitter-bootstrap/js/bootstrap.bundle.min.js"></script>
    </environment>

    <environment exclude="Development">
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" />
        <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script>
    </environment>

    <link href="~/lib/FDBootstrap/css/fluent.css" rel="stylesheet" />
    <link href="~/lib/micon/css/micon.min.css" rel="stylesheet" />


    <script src="https://cdn.jsdelivr.net/npm/jquery-validation@1.19.3/dist/jquery.validate.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/jquery-validation-unobtrusive@3.2.12/dist/jquery.validate.unobtrusive.min.js"></script>

    @if (IsSectionDefined("HeadScripts"))
    {
        @await RenderSectionAsync("HeadScripts", required: false)
    }
    <link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />
</head>
<body>
<div class="container-fluid p-0 min-vh-100" style="background-image: url(/images/backround.svg); background-attachment: fixed">
    <!-- Navbar -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="collapse navbar-collapse" id="navbarExample">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item">
                    <a class="nav-link" asp-controller="Home" asp-action="Index">
                        <i class="mi mi-ChevronLeft"></i>
                        返回首页
                        <span class="sr-only">(current)</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" asp-controller="Admin" asp-action="EditArchive" asp-route-aid="">写文章</a>
                </li>
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" id="navbar-manage" role="button" data-toggle="dropdown" aria-haspopup="true"
                       aria-expanded="false">
                        管理
                    </a>
                    <div class="dropdown-menu" aria-labelledby="navbar-manage">
                        <a class="dropdown-item" asp-controller="Admin" asp-action="Manage" asp-route-manageItemType="archive">文章</a>
                        <a class="dropdown-item" asp-controller="Admin" asp-action="Manage" asp-route-manageItemType="category">分类</a>
                        <a class="dropdown-item" asp-controller="Admin" asp-action="Manage" asp-route-manageItemType="tag">标签</a>
                        <a class="dropdown-item" asp-controller="Admin" asp-action="Manage" asp-route-manageItemType="feed">动态</a>
                        <a class="dropdown-item" asp-controller="Admin" asp-action="Manage" asp-route-manageItemType="friend">友链</a>
                    </div>
                </li>
                <li class="nav-item">
                    <a class="nav-link" asp-controller="Admin" asp-action="Config" asp-route-aid="">设置</a>
                </li>
            </ul>
            <ul class="navbar-nav ml-auto">
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" id="navbar-user" role="button" data-toggle="dropdown" aria-haspopup="true"
                       aria-expanded="false">
                        @Context.User.Identity?.Name
                    </a>
                    <div class="dropdown-menu" aria-labelledby="navbar-user">
                        <a class="dropdown-item" asp-controller="Admin" asp-action="Logout">注销</a>
                    </div>
                </li>
            </ul>
        </div>
    </nav>
    <!-- Navbar -->

    <div class="pt-4"></div>
    <div class="card shadow m-auto w-75" style="min-height: 80vh">
        @RenderBody()
    </div>
    <div class="pt-4"></div>
</div>
@if (IsSectionDefined("BottomScripts"))
{
    @await RenderSectionAsync("BottomScripts", required: false)
}
</body>
</html>